package ac.svn.accesscontrol.ui.panel;

import java.awt.BorderLayout;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.border.TitledBorder;

public class SVNItemInformationPanel extends JPanel
{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JTable propertyTable;
	private static Vector<String> headings;

	public SVNItemInformationPanel()
	{
		super((new BorderLayout()),true);
		initComponents();
	}

	private void initComponents() {
		headings = new Vector<String>(2);
		headings.add("Property");
		headings.add("Value");

		Vector<Vector<String>> data = new Vector<Vector<String>>();
		for(int i = 0 ; i < 10 ; i++)
		{
			Vector<String> rowData = new Vector<String>();
			for(int j = 0 ; j < 10 ; j++)
			{
				rowData.add(String.valueOf(j));
			}
			data.add(rowData);
		}

		propertyTable = new JTable(data,headings);

		JScrollPane scrollPane = new JScrollPane(propertyTable);
		scrollPane.setBorder(new TitledBorder("Information"));
		add(scrollPane,BorderLayout.CENTER);
	}

	public static void main(String args[]) throws Exception
	{
		
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		
		JFrame frame = new JFrame("Test");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(600, 400);
		frame.add(new SVNItemInformationPanel());
		frame.setVisible(true);
	}

}
